/*
 * DTD.h
 *
 *  Created on: 19 mars 2012
 *      Author: ubberlisk
 */

#ifndef DTD_H_
#define DTD_H_

#include <map>
#include <vector>
#include <string>
#include <iostream>
#include "DeclElement.h"
#include "AttributDTD.h"

using namespace std;

class DTD {
public:
	DTD();
	virtual ~DTD();
	void addElement(string name,DeclElement* element);
	void SetMapElement(map<string,DeclElement*> * vd);
	void SetMapElement(vector<DeclElement *>* ve);
	map<string,DeclElement*> * getMapElement();
	void addAttToElement(string nameElement,string nameAttribut,AttributDTD *attl);
	map<string,map<string,AttributDTD*> >* getAttList();
	void setAttlist(map<string,map<string,AttributDTD*> >* attli);
	map<string,AttributDTD*> * getAttMapByName(string EleName); //Element Name --> map<attribut name,attribut>
	AttributDTD* getAttByName(string EleName,string AttName); //search vector<AttList> for a Attlist with name "name", if not exist,return a new AttList
	void afficher();

protected:
	string doctype;
	map<string,DeclElement*> declarations; //Element Name  -> Declaration
	map<string,map<string,AttributDTD*> > attlist;   // Element Name -> Attribut Name --> Attribut



};

#endif /* DTD_H_ */
